/**
******************************************************************************
* @file    main.c 
* @author  jobs
* @version v0.00
* @date    2021-03-04
* @brief   
* @note    
*
******************************************************************************
*/

#include <stdint.h>

#include "bsp_clock.h"
#include "LPC51U68.h"
#include "system_LPC51U68.h"
#include "timeouts.h"

int32_t time_line_ms = 0;

void main(void)
{
  main_clock_init();

  SysTick_Config(SystemCoreClock / 1000);

  front_led_init();

  sys_timeouts_init();
  while (1)
  {
    sys_check_timeouts();
    // __WFI;
  }
}

uint32_t get_sysnow(void)
{
  return (time_line_ms);
}

/**
 * @brief    Handle interrupt from SysTick timer
 * @return    Nothing
 */
void SysTick_Handler(void)
{
  time_line_ms++;
}

/******************************** END OF FILE *********************************/
